#ifndef SURFACE_H
#define SURFACE
class chess_info{
    public:
	char current_chess;
	int current_x;
	int current_y;
};

class surface{
    public:
    int x,y;
    char default_char = ' ';
    char *_cache;
    char *display_cache();
	void update_info(chess_info*);
    void remove_null_char();
    void display();
    void add_surface(int x,int y,int pos_x,int pos_y,char *surface);
    surface(int x,int y,char default_char = ' ');
    ~surface();
}; 

class surface_chessboard:public surface{
	public:
	char all_chess[2];
    char current_chess;
	int current_chess_x,current_chess_y;
    char *display_cache();
	void update_info(chess_info*);
    int is_five_in_row_for_single_chess(int,int,char);
	int is_five_in_row(); 
    surface_chessboard(int x,int y,char *all_char,char default_char=' '):surface(x,y,default_char){
        all_chess[0] = all_char[0];
        all_chess[1] = all_char[1];
    }
};
class surface_infoboard:public surface{
    public:
    time_t start_time;
    time_t this_step_start_time;
    char who_play_this_step;
    char *display_cache();
	void update_info(chess_info*);
    surface_infoboard(int x,int y);
};    
#endif
